package com.ruoyi.shortplay.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shortplay.mapper.VideoCoverMapper;
import com.ruoyi.shortplay.domain.VideoCover;
import com.ruoyi.shortplay.service.IVideoCoverService;

/**
 * AI封面Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-18
 */
@Service
public class VideoCoverServiceImpl implements IVideoCoverService 
{
    @Autowired
    private VideoCoverMapper videoCoverMapper;

    /**
     * 查询AI封面
     * 
     * @param id AI封面主键
     * @return AI封面
     */
    @Override
    public VideoCover selectVideoCoverById(Long id)
    {
        return videoCoverMapper.selectVideoCoverById(id);
    }

    /**
     * 查询AI封面列表
     * 
     * @param videoCover AI封面
     * @return AI封面
     */
    @Override
    public List<VideoCover> selectVideoCoverList(VideoCover videoCover)
    {
        return videoCoverMapper.selectVideoCoverList(videoCover);
    }

    /**
     * 新增AI封面
     * 
     * @param videoCover AI封面
     * @return 结果
     */
    @Override
    public int insertVideoCover(VideoCover videoCover)
    {
        videoCover.setCreateTime(DateUtils.getNowDate());
        return videoCoverMapper.insertVideoCover(videoCover);
    }

    /**
     * 修改AI封面
     * 
     * @param videoCover AI封面
     * @return 结果
     */
    @Override
    public int updateVideoCover(VideoCover videoCover)
    {
        videoCover.setUpdateTime(DateUtils.getNowDate());
        return videoCoverMapper.updateVideoCover(videoCover);
    }

    /**
     * 批量删除AI封面
     * 
     * @param ids 需要删除的AI封面主键
     * @return 结果
     */
    @Override
    public int deleteVideoCoverByIds(Long[] ids)
    {
        return videoCoverMapper.deleteVideoCoverByIds(ids);
    }

    /**
     * 删除AI封面信息
     * 
     * @param id AI封面主键
     * @return 结果
     */
    @Override
    public int deleteVideoCoverById(Long id)
    {
        return videoCoverMapper.deleteVideoCoverById(id);
    }
}
